﻿//------------------------------------------------------------
// shaco Framework
// Copyright © 2017-2021 chang.liu All rights reserved.
// Feedback: 449612236@qq.com
//------------------------------------------------------------

namespace shaco.Base
{
    /// <summary>
    /// 游戏接口类型属性，标记了该属性的会在GameHelperWindow窗口中绘制
    /// </summary>
    [System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple = false)]
    public class GameInterfaceTypeAtrribute : System.Attribute
    {
        public GameInterfaceTypeAtrribute(string header, string groupName, params System.Type[] ignoreTypes)
        {
            this.header = header;
            this.groupName = groupName;
            this.ignoreTypes = ignoreTypes;
        }

        public GameInterfaceTypeAtrribute(string header, string groupName, bool isCustomDrawerOrBaseType, params System.Type[] ignoreTypes)
        {
            this.header = header;
            this.groupName = groupName;
            this.isCustomDrawerOrBaseType = isCustomDrawerOrBaseType;
            this.ignoreTypes = ignoreTypes;
        }

        public GameInterfaceTypeAtrribute(string header, string groupName, System.Type defaultListNewValueType, bool isCustomDrawerOrBaseType, params System.Type[] ignoreTypes)
        {
            this.header = header;
            this.groupName = groupName;
            this.isCustomDrawerOrBaseType = isCustomDrawerOrBaseType;
            this.defaultListNewValueType = defaultListNewValueType;
            this.ignoreTypes = ignoreTypes;
        }

        /// <summary>
        /// 接口名字
        /// </summary>
        public string header = string.Empty;

        /// <summary>
        /// 接口脚本类型
        /// </summary>
        public string groupName = string.Empty;

        /// <summary>
        /// 不允许使用的类型
        /// </summary>
        public System.Type[] ignoreTypes = null;

        /// <summary>
        /// 是否使用自定义绘制(集成ICustomValueDrawer接口实现)
        /// 或者为基础数据类型绘制(如bool、int、List<int>等)
        /// </summary>
        public bool isCustomDrawerOrBaseType = false;

        /// <summary>
        /// 数组默认添加数据
        /// </summary>
        public System.Type defaultListNewValueType = null;
    }
}